﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BDPAutodetect.Models
{
    /// <summary>
    /// 工位指标检测记录
    /// </summary>
    public class TDetectRecordData : TBase
    {
        /// <summary>
        /// 检测时间
        /// </summary>
        public DateTime SampleDateTime { get; set; }
        /// <summary>
        /// 检测时长（单位/s）
        /// </summary>
        public int SampleDuration { get; set; }
        /// <summary>
        /// 工位ID
        /// </summary>
        public int StationID { get; set; }
        /// <summary>
        /// 参数ID
        /// </summary>
        public int ParameterID { get; set; }
        /// <summary>
        /// 条码
        /// </summary>
        public string? Barcode { get; set; }
        /// <summary>
        /// 进入测试模式
        /// </summary>
        public string? DebugModeStart { get; set; }
        /// <summary>
        /// UI板SW版本号
        /// </summary>
        public string? SoftwareVersion { get; set; }
        /// <summary>
        /// 料筒微动开关
        /// </summary>
        public string? WitchBarrelMicro { get; set; }
        /// <summary>
        /// 倾倒开关
        /// </summary>
        public string? WitchTipping { get; set; }
        /// <summary>
        /// NTC温度
        /// </summary>
        public decimal NTCTemperature { get; set; }
        /// <summary>
        /// 压缩机功率
        /// </summary>
        public decimal CompressorPower { get; set; }
        /// <summary>
        /// 压缩机电流
        /// </summary>
        public decimal CompressorCurrent { get; set; }
        /// <summary>
        /// 压缩机电压
        /// </summary>
        public decimal CompressorVoltage { get; set; }
        /// <summary>
        /// 冷凝器风扇功率
        /// </summary>
        public decimal CondenserFanPower { get; set; }
        /// <summary>
        /// 电机功率
        /// </summary>
        public decimal MotorPower { get; set; }
        /// <summary>
        /// 电机电流
        /// </summary>
        public decimal MotorCurrent { get; set; }
        /// <summary>
        /// 电机电压
        /// </summary>
        public decimal MotorVoltage { get; set; }
        /// <summary>
        /// 环境温度
        /// </summary>
        public decimal EnvironmentTemperature { get; set; }
        /// <summary>
        /// 记录操作用户ID
        /// </summary>
        public int UserID { get; set; }
        /// <summary>
        /// 记检测状态(默认0合格，1不合格)
        /// </summary>
        public int StatusFlag { get; set; }
        /// <summary>
        /// 记检测状态(显示名称)
        /// </summary>
        public string StatusDisplay => StatusFlag == 0 ? "合格" : "不合格";

        /// <summary>
        /// 构造函数
        /// </summary>
        public TDetectRecordData() 
            : base()
        {

        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="argSampleDateTime"></param>
        /// <param name="argStationID"></param>
        /// <param name="argBarcode"></param>
        public TDetectRecordData(DateTime argSampleDateTime, int argStationID)
            : base()
        {
            this.SampleDateTime = argSampleDateTime;
            this.StationID = argStationID;            
        }

    }
}
